<template>
	<view>
		<uni-card v-for="temp in MySportsList"
			@tap="getMyList()">
			<text class="uni-body">学号：{{temp.userName}}</text>
			<br>
			<text class="uni-body">部门：{{temp.sysDept.deptName}}</text>
			<br>
			<text class="uni-body">学年：{{temp.gxsYearname.gxsYearname}}</text>
			<br>
			<text class="uni-body">加分原因：{{temp.gxsAddCause}}</text>
			<br>
			<text class="uni-body">加分状态：{{temp.gxsBonusState}}</text>
			<br>
			<text class="uni-body">加分分数：{{temp.gxsScore}}</text>
			<br>
			<text class="uni-body">总分：{{temp.gxsTotalPoints}}</text>
			<br>
			<text class="uni-body">备注：{{temp.remark}}</text>
		</uni-card>
	</view>
</template>

<script>
	import { MyListSports } from '@/api/gxs/sports.js'
	import { getDicts } from "@/api/system/dict/data.js";
	export default {
		data() {
			return {
				statusOptions: [],//字典类型
				MySportsList: [] //列表
			}
		},
		onLoad() {
			this.getMyList(),
			getDicts("gxs_if_awarded").then(response => {
			  this.statusOptions = response.data;
			});
		},
		methods: {
			//获取体美劳列表
			getMyList() {
				MyListSports().then(response => {
					this.MySportsList = response.rows;
					this.MySportsList.forEach((self, index) => {
					   let status = this.statusOptions.find(item => item.dictValue == self.gxsBonusState);
					   self.gxsBonusState = status.dictLabel;
					});
				});
			},
		}
	}
</script>

<style lang="scss">
	uni-card {
		width: 48%;
		border: 1px solid #ccc;
		border-radius: 5px;
		padding: 10px;
		margin-bottom: 10px;
	}
	.uni-body {
		font-size: 16px;
		line-height: 1.5;
	}
</style>